package com.hangwei.paperless.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.hangwei.paperless.R;

/**
 * Created by 张龙臣 on 2020/11/20.
 */

public class PicFragment extends Fragment {

    public interface ViewInit {
        void initView(View view);
    }

    public void setViewInit(ViewInit viewInit) {
        mViewInit = viewInit;
    }

    private ViewInit mViewInit;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View inflate = LayoutInflater.from(container.getContext()).inflate(R.layout.item_big_pic, container, false);
//        ImageView ivLeft = inflate.findViewById(R.id.ivLeft);
//        ImageView back = inflate.findViewById(R.id.back);
//        ImageView ivRight = inflate.findViewById(R.id.ivRight);
//        SimpleDraweeView sdv = inflate.findViewById(R.id.sdv);
//            ivLeft.setVisibility(position == 0 ? View.INVISIBLE : View.VISIBLE);
//            ivRight.setVisibility(position == mList.size() - 1 ? View.INVISIBLE : View.VISIBLE);
        if (mViewInit != null)
            mViewInit.initView(inflate);
        return inflate;
    }
}
